<template>
  <div class="w-100 bg-white rounded">
    <div class="row-ac-fw flex-1 mt-1">
      <div class="nav-item row-a-j-fc" v-for="(item, index) in navigationList" :key="item.id"
        v-if="navigationList.length > 0">
        <div class="img-box">
          <img :src="item.image" />
        </div>
        <div class="font-s-1 mt">{{ item.title }}</div>
      </div>
      <div class="nav-item row-a-j-fc" v-for="i in 10" :key="i" v-else>
        <div class="img-box"></div>
        <div class="font-s-1 mt">导航</div>
      </div>
    </div>
  </div>
</template>

<script>
  import {
    navigationUrl
  } from "@/utils/clientistration"
  export default {
    data() {
      return {
        navigationList: []
      }
    },
    props: {
      navigationId: {
        type: Number,
        default: ''
      },
    },
    created() {
      this.getNavigationList()
    },
    methods: {
      getNavigationList() {
        this.$get(navigationUrl).then(res => {
          this.navigationList = res.data.data.list
          console.log('导航', this.navigationList);
        })
      },
    }
  }
</script>

<style lang="scss">
  .nav-item {
    width: 20%;
    height: 76px;

    .img-box {
      width: 38px;
      height: 38px;
      border-radius: 2.5rem;
      background-color: #EEEEEE;

      img {
        width: 38px;
        height: 38px;
        border-radius: 2.5rem;
      }
    }
  }
</style>
